package com.bruan.d3_TestCalendar;

import java.util.Calendar;

public class Test {
    public static void main(String[] args) {
        //得到日历对象
        Calendar cal = Calendar.getInstance();
        System.out.println(cal);
        System.out.println(cal.get(Calendar.YEAR));
        System.out.println(cal.getTime());
        System.out.println(cal.getTimeInMillis());

        cal.set(Calendar.MONTH,9);//修改月份为10月份（0-9）
        System.out.println(cal);
        System.out.println(cal.getTime());

        cal.add(Calendar.MONTH,100);
        System.out.println(cal.getTime());

    }
}
